package com.own.system.mapper;

import com.own.system.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;

import java.util.List;

/**
 * Mapper 接口
 * @author anonymous
 * @since 2024-08-15
 */
public interface UserMapper extends BaseMapper<User> {
    @Delete("delete from sys_user_role where user_id = #{userId}")
    int deleteUserRole(Long userId);

    /**
     * 保存用户角色关系
     * @param userId
     * @param roleId
     * @return
     */
    int saveUserRole(Long userId, List<Long> roleId);

}
